﻿/*********************************************************************************
 *Author:         OnClick
 *Version:        1.0
 *UnityVersion:   2018.3.11f1
 *Date:           2019-04-15
 *Description:    IFramework
 *History:        2018.11--
*********************************************************************************/
using UnityEngine;

namespace IFramework
{
    public class ABCollectWindowListview  : IEditorGUI
    {
        private Vector2 scrollPos;
        public override void OnGUI(Rect rect, Rect worldRect)
        {
            base.OnGUI(rect, worldRect);
            DrawBackGround(rect);
            DrawArea(() => {
                scrollPos = DrawScrollView(() => {
                    for (int i = 0; i < ABCollectWindow.colletors.Count;i++)
                    {
                        Space(5);
                        if (i % 2 == 0)
                            DrawBackGround(new Rect(0, (i) * 25, rect.width, 25));
                        ABCollectWindow.colletors[i].OnGUI(new Rect(0, (i+1) * 15, rect.width, 15),
                            new Rect(WorldRect.x + 200, WorldRect.y + i * 15, rect.width, 15));
                    }
                }, scrollPos, false, false);
            }, new Rect(rect.x + 5, rect.y + 5, rect.width - 5, rect.height - 20));
        }
    }

}
